import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    autoResize: null // 一个变量(时间戳),改变时触发图表调整大小
  },

  mutations: {
    RESIZE: (state, autoResize) => {
      state.autoResize = autoResize
    },
  },
  actions: {
    RESIZE({
      commit
    }, autoResize) {
      commit('RESIZE', autoResize)
    },
  },
  getters: {
    autoResize: state => state.autoResize,
  },
})
